Repository navigation
Conversation
Member
Author
|
@naveen-manohar fyi. |
There was a problem hiding this comment.
🟡 Changes recommended
Audio offload can bypass connection and security setup on unconnected sockets, while concurrent codec changes can leave controller streams running without handles for cleanup.
8 open issues
Require an established BR/EDR channel before enabling offload · New Serialize concurrent offload selection and teardown · New Preserve negotiated LC3 settings instead of guessing frequency · New Build LC3 receive configuration from incoming QoS · New Set selected codec before incoming CIS/BIS data-path setup · New Reject codec capability TLVs that mismatch the selected codec · New Reject AAC limits below the supported bitrate floor · New Propagate listener codec before accepting non-deferred links · New
Review effort: Balanced
lgirdwood
commented
Nov 13, 2026
When an Intel Bluetooth controller boots or reloads, offload callback registration depends on the firmware state encountered in btintel_bootloader_setup_tlv(): 1. On a cold boot (ver->img_type != BTINTEL_IMG_OP), execution downloads operational firmware, loads DDC (btintel_load_ddc_config()), and calls btintel_configure_offload(hdev) to set hdev->get_data_path_id and hdev->get_codec_config_data. 2. On a warm reboot or PCIe/USB driver reload where the controller is already running operational firmware (ver->img_type == BTINTEL_IMG_OP), btintel_bootloader_setup_tlv() jumps straight to the finish: label, bypassing btintel_configure_offload(hdev). 3. Because hdev->get_data_path_id and hdev->get_codec_config_data remain NULL, subsequent BT_CODEC offload queries and configuration fail with -EOPNOTSUPP. Move btintel_configure_offload(hdev) under the finish: label so offload callbacks are registered on both cold boot and operational-firmware boot paths. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Set HCI_OFFLOAD_CODECS_ENABLED in btintel_configure_offload() when 0xfc86 (HCI_Intel_Read_Offload_Use_Cases) reports supported offload use cases (preset[0] & 0x03), so hci_dev_open_sync() queries the controller's local offload codecs (0x100d / 0x100e) during adapter initialization. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add HCI_OP_ENHANCED_ACCEPT_SYNC_CONN (0x043e) and hci_accept_sync() so incoming eSCO/SCO connections on sockets configured with BT_CODEC (data_path != 0) configure the controller data path (0x0c83) and accept the synchronous connection over the offloaded PCM/SSP transport instead of falling back to legacy HCI_OP_ACCEPT_SYNC_CONN_REQ (0x0429). Allow setting BT_CODEC on listening SCO sockets, propagate the listening socket's codec settings onto conn in hci_conn_request_evt() for non-deferred accepts as well as child sockets during sco_sock_init(), and invoke hci_accept_sync() whenever an offloaded data path is configured. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Enable DDC 0x0130 (0x3f: LC3, SCO, A2DP SBC/AAC, LE Audio vendor codec, and controller delay reporting) and DDC 0x0120 (0x0b: SCO, LE ISO, and A2DP offload use cases) via HCI_Intel_Write_DDC (0xfc8b) during btintel_configure_offload() so HCI_Read_Local_Supported_Codecs_v2 (0x100d) and HCI_Read_Local_Supported_Codec_Capabilities (0x100e) report all hardware offload codecs supported by operational firmware. Extend btintel_get_codec_config_data() to configure 16 kHz SCO presets (0x01) for non-CVSD SCO codecs and 48 kHz 16-bit stereo SSP offload (preset 0x22) for ACL and LE CIS/BIS links. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add BT_CODEC getsockopt and setsockopt support to BTPROTO_ISO (for HCI_TRANSPORT_LE_CIS and HCI_TRANSPORT_LE_BIS offload codecs such as LC3 and vendor LE Audio codecs) and BTPROTO_L2CAP (for HCI_TRANSPORT_ACL A2DP offload codecs such as Intel SBC 0x0002:0x0000 and AAC 0x0002:0x0002), and export hci_configure_datapath() for use by L2CAP and ISO data path setup. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Update hci_iso_setup_path() to configure the controller data path (0x0c83) via hci_configure_datapath() and pass the requested data_path, codec ID, and vendor CID/VID to HCI_LE_Setup_ISO_Data_Path (0x206e) when offload is enabled. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Implement Microsoft HCI vendor extension (0xfc1e) subcommands 0x07..0x0b (HCI_VS_MSFT_Avdtp_Capabilities_Configuration, Avdtp_Open, Avdtp_Start, Avdtp_Suspend, and Avdtp_Close) when MSFT_FEATURE_MASK_AVDTP (BIT(10)) is advertised by the controller. During msft_do_open(), query subcommand 0x07 and register the controller's offloaded AVDTP Media Codec Service Capabilities (SBC 0x00 and MPEG-2,4 AAC 0x02) into hdev->local_codecs under HCI_TRANSPORT_ACL. When setsockopt(SOL_BLUETOOTH, BT_CODEC) is called on a connected BR/EDR ACL BTPROTO_L2CAP channel, serialize stream transitions under chan->avdtp_lock, validate supplied SBC/AAC capability TLVs and AAC bitrates (>= 128 kbps), invoke msft_avdtp_open() to open and start hardware A2DP offload on the controller's SSP TDM interface, and automatically close any active stream on disable or L2CAP release. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Configure 8 kHz SSP PCM preset 0x00 in btintel_get_codec_config_data() for 8 kHz synchronous codecs (0x00 u-law, 0x01 A-law, 0x02 CVSD, 0x03 Transparent, and 0x04 Linear PCM) while keeping 16 kHz preset 0x01 for 0x05 mSBC. Update hci_enhanced_setup_sync() and hci_enhanced_accept_sync() to pass the requested over-the-air coding format ID for G.711 u-law (0x00) and A-law (0x01) connections instead of hardcoding CVSD (0x02). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Support hardware LC3 offload over SSP for LE Audio CIS and BIS links: - Validate and store user-supplied LC3 Codec_Specific_Configuration LTV capabilities from setsockopt(BT_CODEC) on iso_pi(sk) and hci_conn (checking Sampling_Frequency via btintel_get_codec_config_data()). - Update btintel_lc3_freq_preset() to map LC3 Sampling_Frequency 16 kHz (0x03) to preset 0x01 and 48 kHz (0x08) to preset 0x22, rejecting unsupported rates with -EINVAL. - Build direction-specific LC3 LTV configuration and QoS parameters for TX and RX paths (both ucast CIS and bcast BIS) in hci_iso_setup_path(), handling 75-octet 7.5 ms frames (48_1) cleanly when deriving defaults. - Propagate listener codec configuration onto hci_conn before hci_iso_setup_path() runs in hci_le_cis_req_evt() and hci_le_big_sync_established_evt(), covering non-deferred CIS and BIG sync paths as well as BT_DEFER_SETUP and iso_conn_ready(). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
This series enables full Bluetooth SSP (
SSP2-BT,Data_Path_ID = 0x01) hardware and Transparent-mode audio offload across HFP/eSCO (BTPROTO_SCO), LE Audio CIS/BIS (BTPROTO_ISO), and A2DP (BTPROTO_L2CAP) on Intel Bluetooth controllers paired with Sound Open Firmware (SOF) DSPs:Bluetooth: btintel: configure offload on operational boot(dc45683418df):btintel_configure_offload()when booting directly in operational firmware state (BTINTEL_IMG_OP) and setsHCI_OFFLOAD_CODECS_ENABLEDsoBT_CODECsocket discovery is active immediately.Bluetooth: sco: support Enhanced Accept Synchronous Connection(743e0b03a5c0):HCI_OP_ENHANCED_ACCEPT_SYNC_CONN(0x043e) andhci_accept_sync()so incoming eSCO/SCO connections onBT_CODEC-configured sockets configure the controller data path (0x0c83) and accept synchronous links overSSP2-BTinstead of legacy HCI PCM.Bluetooth: btintel: enable DDC offload codecs and ACL/ISO paths(b1336bc95213):0x0130(0x3f) and0x0120(0x0b) via0xfc8bduringbtintel_configure_offload()so0x100d/0x100eexpose SCO, LE Audio ISO, and A2DP offload capabilities, and configures SSP presets inbtintel_get_codec_config_data().Bluetooth: iso, l2cap: support BT_CODEC offload and data path(198a7de7a83d):BT_CODECgetsockopt()/setsockopt()discovery and selection onBTPROTO_ISO(HCI_TRANSPORT_LE_CIS/LE_BIS) andBTPROTO_L2CAP(HCI_TRANSPORT_ACL), and updateshci_iso_setup_path()to configure0x0c83and0x206e(HCI_LE_Setup_ISO_Data_Path) for offloaded ISO streams.Bluetooth: msft: support AVDTP A2DP hardware offload over SSP(c9028e599d53):0xfc1e) subcommands0x07..0x0b(Avdtp_Capabilities_Configuration,Avdtp_Open,Avdtp_Start,Avdtp_Suspend,Avdtp_Close) whenMSFT_FEATURE_MASK_AVDTP(BIT(10)) is advertised, registering offloaded SBC (0x00) and AAC (0x02) capabilities underHCI_TRANSPORT_ACLand managing stream lifecycle onBTPROTO_L2CAPsockets.Bluetooth: hci_conn, btintel: support u-law and A-law SCO offload(2e0ede4f3900):0x00for0x00(G.711 u-law),0x01(G.711 A-law),0x02(CVSD),0x03(Transparent), and0x04(Linear PCM), and passes the selected coding format ID inhci_enhanced_setup_sync()andhci_enhanced_accept_sync().Bluetooth: hci_conn, iso, btintel: support LE CIS LC3 SSP offload(55bbf62a067b):0x01forCIS_LINK/BIS_LINK, populates Bluetooth SIG LC3 LTVCodec_Specific_Configuration(Sampling_Frequency,Frame_Duration,Octets_Per_Codec_Frame) inhci_iso_setup_path()when offloadingBT_CODEC_LC3(0x06), and propagatesBT_CODEContohcon->codeciniso_conn_ready()for CIS Peripheral offload.Hardware Validation (Over-the-Air DSP-to-DSP
SSP2-BThw:0,20)Validated bi-directionally (
500 HzTX on Wildcat Lakeladybird[ibt-1190-01a1-pci] ↔1000 HzTX on Panther Lakedamsel-fly[ibt-00a0-0041-pci] and Arrow Lakedragon-fly[BE200]):ladybirdRX FFT (1000 HzTX)damsel-flyRX FFT (500 HzTX)BTPROTO_L2CAP)SBC (0x00)(48 kHz 2ch)999.97 Hz(RMS 14119.6)499.35 Hz(RMS 14135.0)BTPROTO_L2CAP)AAC (0x02)(48 kHz 2ch)1000.08 Hz(RMS 13707.5)500.57 Hz(RMS 13727.3)BTPROTO_SCO)mSBC (0x05)(16 kHz 1ch)999.90 Hz(RMS 14142.7)500.08 Hz(RMS 14123.5)BTPROTO_SCO)CVSD (0x02)(8 kHz 1ch)1000.14 Hz(RMS 10833.2)499.37 Hz(RMS 13668.5)BTPROTO_SCO)G.711 u-law (0x00)(8 kHz 1ch)1000.00 Hz(RMS 14006.2)499.86 Hz(RMS 14177.9)BTPROTO_SCO)G.711 A-law (0x01)(8 kHz 1ch)1000.29 Hz(RMS 14098.8)500.57 Hz(RMS 14261.1)BTPROTO_SCO)Transparent (0x03)Raw PCM + SOF DSP (LC3,mSBC,G.722,aptX)999.77..1000.45 Hz(RMS >14100)499.86..500.08 Hz(RMS >14100)BTPROTO_ISO)LC3 (0x06)(16 kHz 1ch)1000.03 Hz(RMS 15343.7)499.89 Hz(RMS 15503.1)